<?php

namespace App\Models\Api;

class CompanyContact extends ApiModel
{
    //表名
    protected $table = 'company_contact';

    const CREATED_AT = 'addtime';
    const UPDATED_AT = 'updatetime';

    protected $guarded = [];

    /**
     * The attributes that should be hidden for arrays.
     * 隐藏字段
     * @var array
     */
    protected $hidden = ['addtime', 'updatetime', 'id', 'uid', 'job_id'];

    /**
     * 要触发的所有关联关系(子类增删改更新父类updatetime)
     *
     * @var array
     */
    protected $touches = ['company_job'];

    /**
     * 联系方式所属岗位
     */
    public function company_job()
    {
        return $this->belongsTo(CompanyJob::class, 'job_id', 'id');
    }
}
